package 定时器.Test01;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Timer;

public class TimerTest01 {
    public static void main(String[] args) {
        Timer timer = new Timer();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        try {
            Date currentTime = new Date();
            Date firstTime = sdf.parse("2020-12-12 17:33:10");
            timer.schedule(new LogTimerTask(),currentTime,1000 * 10);
        } catch (ParseException e) {
            e.printStackTrace();
        }

    }
}
